<?php

/**
 * Clientsplatforms form base class.
 *
 * @method Clientsplatforms getObject() Returns the current form's model object
 *
 * @package    explications_informatiques
 * @subpackage form
 * @author     Guimezanes Cyrille
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseClientsplatformsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idclientsplatforms' => new sfWidgetFormInputHidden(),
      'id_client'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('SfGuardUserProfile'), 'add_empty' => true)),
      'id_platform'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Platform'), 'add_empty' => true)),
      'version'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Plateformversion'), 'add_empty' => true)),
      'id_group_platform'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Platformgroup'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'idclientsplatforms' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idclientsplatforms')), 'empty_value' => $this->getObject()->get('idclientsplatforms'), 'required' => false)),
      'id_client'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('SfGuardUserProfile'), 'required' => false)),
      'id_platform'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Platform'), 'required' => false)),
      'version'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Plateformversion'), 'required' => false)),
      'id_group_platform'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Platformgroup'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('clientsplatforms[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Clientsplatforms';
  }

}
